package br.com.iswe.gwt.ui.client;

import java.util.ArrayList;
import java.util.List;

public class ListenerCollection<T> implements Listener<T> {

	private List<Listener<T>> listenerCollection = new ArrayList<Listener<T>>();
	
	public void fire(T object) {
		for (Listener<T> listener : listenerCollection ) {
			listener.execute(object);
		}
	}
	public void add(Listener<T> listener) {
		listenerCollection.add(listener);
	}
	
	public void execute(T object) {
		fire(object);
	}
	
}
